<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>xilrsa: XilRSA APIs and Descriptions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">xilrsa
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;"
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__xilrsa__apis.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">XilRSA APIs and Descriptions</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga94cb0e9ea77ca68a380c25b42910fa8e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilrsa__apis.html#ga94cb0e9ea77ca68a380c25b42910fa8e">rsa2048_exp</a> (const unsigned char *base, const unsigned char *modular, const unsigned char *modular_ext, const unsigned char *exponent, unsigned char *result)</td></tr>
<tr class="memdesc:ga94cb0e9ea77ca68a380c25b42910fa8e"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to encrypt the data using 2048 bit private key.  <a href="#ga94cb0e9ea77ca68a380c25b42910fa8e">More...</a><br/></td></tr>
<tr class="separator:ga94cb0e9ea77ca68a380c25b42910fa8e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga810797c1bab84cda9d48b734ba8b0405"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilrsa__apis.html#ga810797c1bab84cda9d48b734ba8b0405">rsa2048_pubexp</a> (RSA_NUMBER a, RSA_NUMBER x, unsigned long e, RSA_NUMBER m, RSA_NUMBER rrm)</td></tr>
<tr class="memdesc:ga810797c1bab84cda9d48b734ba8b0405"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to decrypt the data using 2048 bit public key.  <a href="#ga810797c1bab84cda9d48b734ba8b0405">More...</a><br/></td></tr>
<tr class="separator:ga810797c1bab84cda9d48b734ba8b0405"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga735718f1bf2a30893d3e854d439c69fd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilrsa__apis.html#ga735718f1bf2a30893d3e854d439c69fd">sha_256</a> (const unsigned char *in, const unsigned int size, unsigned char *out)</td></tr>
<tr class="memdesc:ga735718f1bf2a30893d3e854d439c69fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function calculates the hash for the input data using SHA-256 algorithm.  <a href="#ga735718f1bf2a30893d3e854d439c69fd">More...</a><br/></td></tr>
<tr class="separator:ga735718f1bf2a30893d3e854d439c69fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaa0bff1f1bcda10be83c3bf2f3af690b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilrsa__apis.html#gaaa0bff1f1bcda10be83c3bf2f3af690b">sha2_starts</a> (sha2_context *ctx)</td></tr>
<tr class="memdesc:gaaa0bff1f1bcda10be83c3bf2f3af690b"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function initializes the SHA2 context.  <a href="#gaaa0bff1f1bcda10be83c3bf2f3af690b">More...</a><br/></td></tr>
<tr class="separator:gaaa0bff1f1bcda10be83c3bf2f3af690b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad03b4e01ae41a4b91888ab05a307bcfe"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilrsa__apis.html#gad03b4e01ae41a4b91888ab05a307bcfe">sha2_update</a> (sha2_context *ctx, unsigned char *input, unsigned int ilen)</td></tr>
<tr class="memdesc:gad03b4e01ae41a4b91888ab05a307bcfe"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function adds the input data to SHA256 calculation.  <a href="#gad03b4e01ae41a4b91888ab05a307bcfe">More...</a><br/></td></tr>
<tr class="separator:gad03b4e01ae41a4b91888ab05a307bcfe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4dbd38a93b5b61c637a8a29dd0e850f0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xilrsa__apis.html#ga4dbd38a93b5b61c637a8a29dd0e850f0">sha2_finish</a> (sha2_context *ctx, unsigned char *output)</td></tr>
<tr class="memdesc:ga4dbd38a93b5b61c637a8a29dd0e850f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function finishes the SHA calculation.  <a href="#ga4dbd38a93b5b61c637a8a29dd0e850f0">More...</a><br/></td></tr>
<tr class="separator:ga4dbd38a93b5b61c637a8a29dd0e850f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga94cb0e9ea77ca68a380c25b42910fa8e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rsa2048_exp </td>
          <td>(</td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>modular</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>modular_ext</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>exponent</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to encrypt the data using 2048 bit private key. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">modular</td><td>A char pointer which contains the key modulus </td></tr>
    <tr><td class="paramname">modular_ext</td><td>A char pointer which contains the key modulus extension </td></tr>
    <tr><td class="paramname">exponent</td><td>A char pointer which contains the private key exponent </td></tr>
    <tr><td class="paramname">result</td><td>A char pointer which contains the encrypted data</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None </dd></dl>

</div>
</div>
<a class="anchor" id="ga810797c1bab84cda9d48b734ba8b0405"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rsa2048_pubexp </td>
          <td>(</td>
          <td class="paramtype">RSA_NUMBER&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">RSA_NUMBER&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>e</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">RSA_NUMBER&#160;</td>
          <td class="paramname"><em>m</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">RSA_NUMBER&#160;</td>
          <td class="paramname"><em>rrm</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to decrypt the data using 2048 bit public key. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>RSA_NUMBER containing the decrypted data. </td></tr>
    <tr><td class="paramname">x</td><td>RSA_NUMBER containing the input data </td></tr>
    <tr><td class="paramname">e</td><td>Unsigned number containing the public key exponent </td></tr>
    <tr><td class="paramname">m</td><td>RSA_NUMBER containing the public key modulus </td></tr>
    <tr><td class="paramname">rrm</td><td>RSA_NUMBER containing the public key modulus extension.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None </dd></dl>

</div>
</div>
<a class="anchor" id="ga4dbd38a93b5b61c637a8a29dd0e850f0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sha2_finish </td>
          <td>(</td>
          <td class="paramtype">sha2_context *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>output</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function finishes the SHA calculation. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>Pointer to sha2_context structure that stores status and buffer. </td></tr>
    <tr><td class="paramname">output</td><td>Pointer to the calculated hash data.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None </dd></dl>

</div>
</div>
<a class="anchor" id="gaaa0bff1f1bcda10be83c3bf2f3af690b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sha2_starts </td>
          <td>(</td>
          <td class="paramtype">sha2_context *&#160;</td>
          <td class="paramname"><em>ctx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function initializes the SHA2 context. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>Pointer to sha2_context structure that stores status and buffer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None </dd></dl>

</div>
</div>
<a class="anchor" id="gad03b4e01ae41a4b91888ab05a307bcfe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sha2_update </td>
          <td>(</td>
          <td class="paramtype">sha2_context *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>input</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>ilen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function adds the input data to SHA256 calculation. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>Pointer to sha2_context structure that stores status and buffer. </td></tr>
    <tr><td class="paramname">input</td><td>Pointer to the data to add. </td></tr>
    <tr><td class="paramname">Out</td><td>Length of the input data.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None </dd></dl>

</div>
</div>
<a class="anchor" id="ga735718f1bf2a30893d3e854d439c69fd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sha_256 </td>
          <td>(</td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned int&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>out</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function calculates the hash for the input data using SHA-256 algorithm. </p>
<p>This function internally calls the sha2_init, updates and finishes functions and updates the result.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">In</td><td>Char pointer which contains the input data. </td></tr>
    <tr><td class="paramname">Size</td><td>Length of the input data </td></tr>
    <tr><td class="paramname">Out</td><td>Pointer to location where resulting hash will be written.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
